UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jhAV6ODf3iUe8MJSuCU6H8FHYWYZFpk0hE3+Sksr89c='
WHERE
key_id = 'f356c7bce2d8cfcc3091796df9f74d8309dceff00953425b54711004bc41d28d'
AND (
token = 'jhAV6ODf3iUe8MJSuCU6H8FHYWYZFpk0hE3+Sksr89c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)