UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Gxqfw9U/XobnnFsz7W4c2Dkc3ALQ9vXpRvCetuqqp1A='
WHERE
key_id = '5143aae3853a512f213bd95a3ca7cc2783e7c387ace975ddcb4efa0e6b110756'
AND (
token = 'Gxqfw9U/XobnnFsz7W4c2Dkc3ALQ9vXpRvCetuqqp1A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)