UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4EvaMPgajVH7dTNetCCx+Pkr1OSOVGaPg44RIeXbHzU='
WHERE
key_id = '05dcd1f3b828c81ccc94afa807a7891acf7646d799a92711fee83efb8ff2a3da'
AND (
token = '4EvaMPgajVH7dTNetCCx+Pkr1OSOVGaPg44RIeXbHzU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)