UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/w8bqjgsx9OqWuIu9fzQSHkYmD8MZBenNqmKaDCwacE=' 
WHERE 
  key_id = '65b116edb5cadc612f56b573fe1ba480c06e2e884686e341d47594ab6267e79f' 
  AND (
    token = '/w8bqjgsx9OqWuIu9fzQSHkYmD8MZBenNqmKaDCwacE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031