UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U1FV35ciA5mv8MFrDdcCHxsegGwhQYp9maT9UbDTWpU='
WHERE
key_id = '5defbdfe2a7a82a8b7f28097bcb898af3dd45761c6c9f7ac9697a37cca6c363a'
AND (
token = 'U1FV35ciA5mv8MFrDdcCHxsegGwhQYp9maT9UbDTWpU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)