UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JqIdj0DhryEKA+ZGwRS4l0mpkQTSNq6WO13LXYf82nc='
WHERE
key_id = '7644e3f7d5a2001c0f54c7276d600037897e5ad13622f62bff9f1990a3ba6479'
AND (
token = 'JqIdj0DhryEKA+ZGwRS4l0mpkQTSNq6WO13LXYf82nc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)