UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4bwZxKOwCDocfsN4Dqz+fqRp25ML7LkT2OnBbj3aqxg='
WHERE
key_id = '9fd5fba8fd306a6ee551845e28c2315bc4cd202f2ccbd84a960a028da3ae0cd4'
AND (
token = '4bwZxKOwCDocfsN4Dqz+fqRp25ML7LkT2OnBbj3aqxg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)