UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8HGaPbKDhapsUqwirxCKspWjR7ceMAKlB5QaUW0Q/e4='
WHERE
key_id = 'bace26236b9124b203f61f4ce37e8f3a0c0722a218abb2d0a684d1cda8ca057d'
AND (
token = '8HGaPbKDhapsUqwirxCKspWjR7ceMAKlB5QaUW0Q/e4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)