UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K7RNdKSq3KdmW0hiS7/vmThLAvqtsosyjgU3TdiCY2I='
WHERE
key_id = '2e63400de85295ec5b143400104361e8fb69cdc02305c1e0ef901c62aa3ee807'
AND (
token = 'K7RNdKSq3KdmW0hiS7/vmThLAvqtsosyjgU3TdiCY2I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)