UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sS/xqQ/DNXS4DlJEuwf9KDfx1ldZL+cYfo2ocZLmmtg=' 
WHERE 
  key_id = '21e233e85026bb469c509c5c11d4115739b2829f5a6484bb310a00506dead1f7' 
  AND (
    token = 'sS/xqQ/DNXS4DlJEuwf9KDfx1ldZL+cYfo2ocZLmmtg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033