UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7o4+202r0uT+dOSZZB7F4hT3LLPaZcU8TLmTWdCthos='
WHERE
key_id = '5434b534ea3c7282709160d4895cc2033a2807727928b0b0c2e572abe5a879cb'
AND (
token = '7o4+202r0uT+dOSZZB7F4hT3LLPaZcU8TLmTWdCthos='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)