UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aRUAhs2XCUGv8jhexX8u5nFck5WhuiWJ8FWK4jq6o1g='
WHERE
key_id = '9927da256815d18378613a6c43ac0afcda48a881a6ebf97f1ce357e55aa2c0f2'
AND (
token = 'aRUAhs2XCUGv8jhexX8u5nFck5WhuiWJ8FWK4jq6o1g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)