UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+pqVWYf8BTbr/ehTYF1PkC5guiWAAWyDC2R5VqEzOP0='
WHERE
key_id = 'cd49aa5b79f9b49aa4ef85a44239fd2b66b0a5704d2be2a0c79eaadeedf7ca81'
AND (
token = '+pqVWYf8BTbr/ehTYF1PkC5guiWAAWyDC2R5VqEzOP0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)