UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'flL8du3g6bTKJNkuQEDlDUtThfgb/4NiI+DHy0hxRL0=' 
WHERE 
  key_id = '271df2525e74d2d545f2e77bcf2840932aecbaffe5d3d21a9d67d0ef993cea44' 
  AND (
    token = 'flL8du3g6bTKJNkuQEDlDUtThfgb/4NiI+DHy0hxRL0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057