UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z+xw2pm7gPJW+dfQG4HFKrv7F/W+BpSn4SrIvfMeMcY=' 
WHERE 
  key_id = '97c4affaf035f72a7a01bd4e6935dd6f0224bca035e8a91b9e7e01e3ddd1a658' 
  AND (
    token = 'z+xw2pm7gPJW+dfQG4HFKrv7F/W+BpSn4SrIvfMeMcY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055