UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B70IRvpRmTizBInbu+PP6UDT3wWzC1JGDACj6psiQP4='
WHERE
key_id = 'a92fb76c504ba2c7f99e150bada1faed9bf2c9e9feecbfe6aced154cca7435ec'
AND (
token = 'B70IRvpRmTizBInbu+PP6UDT3wWzC1JGDACj6psiQP4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)