UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oh4tWnoo1W0mmtfYc5VedDinEz9vsJXXKKoRNQwsiqU='
WHERE
key_id = '4f4f0b45f35ea45f37469c444ce1f7ad6abf398765c55c98031c422f4a8a4847'
AND (
token = 'oh4tWnoo1W0mmtfYc5VedDinEz9vsJXXKKoRNQwsiqU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)