UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nN9ckucayhbQ+GmTjXgo2qTjadK6JK8vNKY6wxedXFs='
WHERE
key_id = '95857e570d221d8090f59d6eed8fd8f45152ce5ee1b61dadbdf3b242083083dc'
AND (
token = 'nN9ckucayhbQ+GmTjXgo2qTjadK6JK8vNKY6wxedXFs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)