UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ihpvefllyRqX/FaVn2N9/7GusOv1/9LxS27hQtIAyNE='
WHERE
key_id = '0b1677f53e5c82d9396b2187d8c6dd8a5596edffc6394d14b00bb4da508b0b1d'
AND (
token = 'ihpvefllyRqX/FaVn2N9/7GusOv1/9LxS27hQtIAyNE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)