UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cj4KpblNs4/UqHI/X5afzIfeffq5HatVIvMrABq862Y='
WHERE
key_id = '83eb2ac2a344676c6b5c5d3eac79945bc4481541c91444c0067edd0e296063db'
AND (
token = 'cj4KpblNs4/UqHI/X5afzIfeffq5HatVIvMrABq862Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)