UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rsY8p2bVWFFETl4UgpN/uA4d4UFzynD3wmbD9lGzWwY=' 
WHERE 
  key_id = '9cf33d257de7756d69f7233b28cc6bcf55ea8a88a66171f2a58836c2cd53a315' 
  AND (
    token = 'rsY8p2bVWFFETl4UgpN/uA4d4UFzynD3wmbD9lGzWwY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024