UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4xUAVUJrQ7F22ktHUbUhMIn637Kwz1Ybxt8VjBovdbg='
WHERE
key_id = '99dd00cfd4b5fb8ab883e465825c7cf17e46fb9f6742d5abb18e58650b54de98'
AND (
token = '4xUAVUJrQ7F22ktHUbUhMIn637Kwz1Ybxt8VjBovdbg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)