UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jVcDhI7Jx1bCkMZCr9AvxYUufPVdYK3oPPeEIoij+ps='
WHERE
key_id = '6e3d7b332715802c5904925eabd5257de2a7cdfb4db443061f4f88269094bfd2'
AND (
token = 'jVcDhI7Jx1bCkMZCr9AvxYUufPVdYK3oPPeEIoij+ps='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)