UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dArElkFFnIsQ7S3xHqNbmoe+HTp9EWIsiCxJFKekESM='
WHERE
key_id = '95b6ca7aed661404337c9534a70cba1b52d1a03db11aa82a94b5c725f5c14196'
AND (
token = 'dArElkFFnIsQ7S3xHqNbmoe+HTp9EWIsiCxJFKekESM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)