UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'r/GO9qYITd/It5aZzVNd6pWo7Gmo2XhWM1qALSq+MXI=' 
WHERE 
  key_id = '63acfef2b1d1d1ec178bfabe500d1d2b6410208cf22c7b353edba93893766dd2' 
  AND (
    token = 'r/GO9qYITd/It5aZzVNd6pWo7Gmo2XhWM1qALSq+MXI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028