UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5tHyMpeGN1OX31J1wy0S1eq5sFqSOBFWWnW6dr3sCE4='
WHERE
key_id = '07d9de6c7b0dd896a336ac866d19e534ca824c9d4dc179a7725bc37d875659b2'
AND (
token = '5tHyMpeGN1OX31J1wy0S1eq5sFqSOBFWWnW6dr3sCE4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)