UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WoZ7K8Kwxa5DehYMkxXZmmrEZIkcb1gztiQ3xUCJgAA='
WHERE
key_id = 'fb6cb33fc0d722e3da7c488b668219de0ab0c67e1012ceb75d3c4bfa139327bd'
AND (
token = 'WoZ7K8Kwxa5DehYMkxXZmmrEZIkcb1gztiQ3xUCJgAA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)