UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4iIV5GwYdrcj3DTzU0DUJlxH+YIfYL/Wp7EksrYOQlk='
WHERE
key_id = '6c5979d7e08710444705732354401b9a2de2ad6e9bf25b548380c778f6acf0ec'
AND (
token = '4iIV5GwYdrcj3DTzU0DUJlxH+YIfYL/Wp7EksrYOQlk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)