UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cFxpanFRcFP4AJ7MaVaufEO9JS/tsJUQlbJ80Zi5ZIk=' 
WHERE 
  key_id = 'ddf02cbd5f2e37abe3b2256c41d9a96368437f32600be8e020b02cc34dbc1a05' 
  AND (
    token = 'cFxpanFRcFP4AJ7MaVaufEO9JS/tsJUQlbJ80Zi5ZIk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018