UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FutMV9hGPNX3Mm5jZvouHjCNdFtKlaT7GSSL+U0x7ak=' 
WHERE 
  key_id = '7fb0db58faad9205cec3084c288c39692fe5e7bc38a14122eae97d091d7246c7' 
  AND (
    token = 'FutMV9hGPNX3Mm5jZvouHjCNdFtKlaT7GSSL+U0x7ak=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027