UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hc2TF8X65VJusJ8P0Dxvt/YVt2e0+6pAc1OpHj904hY=' 
WHERE 
  key_id = 'c11662d58eecea6f9c2c4513c597b81c664687c11b27aef77b619752043dbeec' 
  AND (
    token = 'hc2TF8X65VJusJ8P0Dxvt/YVt2e0+6pAc1OpHj904hY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033