UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UxWAGCvyHmQQwD51HJ9VIFizmZhsDUZYHUPqbwpULDg='
WHERE
key_id = '8372971b3780eb4e8fdbd4395230a059583058e89f8e3fe970d0964333fc1e03'
AND (
token = 'UxWAGCvyHmQQwD51HJ9VIFizmZhsDUZYHUPqbwpULDg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)