UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iAkTsfF6HwZoT2+GQkEsflnsPJq/KHovgXyF68AQbZ8=' 
WHERE 
  key_id = '8bb41c32f694e37e895a30a36a963b2e7c6c7ac724ff4fe5e91adfeb7eea577f' 
  AND (
    token = 'iAkTsfF6HwZoT2+GQkEsflnsPJq/KHovgXyF68AQbZ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018