UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fMpAOSPzXxwjgJjQCu4c7d32e8Ij9h9dOmQSAKcfT4U='
WHERE
key_id = '12c26085f92420465ad58da072b7a553a734a268a861aa59860f0040a0bf88d5'
AND (
token = 'fMpAOSPzXxwjgJjQCu4c7d32e8Ij9h9dOmQSAKcfT4U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)