UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z33OjqMGZ2VPM3kCrCBrYNnVL8u3fwh1nd6968Umx9U=' 
WHERE 
  key_id = '1cc704a1dad2a18a8d623656302b944ba67f5bb54894bc846ad25f28e837e260' 
  AND (
    token = 'z33OjqMGZ2VPM3kCrCBrYNnVL8u3fwh1nd6968Umx9U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047