UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eVRgjk9DXhb6ABcvCUo1KqKtUEkmbsX3/Wi1Jpve8b0='
WHERE
key_id = '902ee49c9a1aebda442cc66976007113a91c2a276f5cb1f8d4138beed5b8e4a2'
AND (
token = 'eVRgjk9DXhb6ABcvCUo1KqKtUEkmbsX3/Wi1Jpve8b0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)