UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jmseV1Sas9uWnbxE9VMPNKN7yZk2s/hISMFgr1H3cHw='
WHERE
key_id = '6565e9abf567e1b56681db58cda5b484a845e610e7b163f7cde184c37ce51b8d'
AND (
token = 'jmseV1Sas9uWnbxE9VMPNKN7yZk2s/hISMFgr1H3cHw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)