UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bGuKbkFu0F68iPXkFqrIqA1dIqnh3Kkjrkam4D3wT4w='
WHERE
key_id = '42f84ac5edba3b35fe4665a10701e8c96c6b790b9d8a99f653d45f266d6de6e8'
AND (
token = 'bGuKbkFu0F68iPXkFqrIqA1dIqnh3Kkjrkam4D3wT4w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)