UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wIabCVLYmIQtXgJoUNiqQBLDxq9tzUIbbYUI+HHFGD8='
WHERE
key_id = 'baecfc1b6fe2476eae782023d78f86805ffe4d6f78675e383ada042d8d15a9e9'
AND (
token = 'wIabCVLYmIQtXgJoUNiqQBLDxq9tzUIbbYUI+HHFGD8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)